Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing type definitions + rename sortFn #734

Merged
merged 19 commits into from
Nov 3, 2019
Merged

Conversation

jshjohnson
Copy link
Collaborator

@jshjohnson jshjohnson commented Nov 2, 2019

Description

  • Update types file
  • Utilised type defs throughout
  • Minor refactoring
  • Renames sortFn to sorter to be consistent with other functions passed via config
  • Renames itemComparer to valueComparer to be clearer about what the function actually does

Screenshots (if appropriate)

Types of changes

  • Chore (tooling change or documentation change)
  • Refactor (non-breaking change which maintains existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jshjohnson jshjohnson added the breaking change Pull request that introduces a breaking change label Nov 2, 2019
@codecov
Copy link

codecov bot commented Nov 2, 2019

Codecov Report

Merging #734 into master will increase coverage by 0.28%.
The diff coverage is 74.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #734      +/-   ##
==========================================
+ Coverage   66.18%   66.46%   +0.28%     
==========================================
  Files          23       22       -1     
  Lines        1307     1309       +2     
==========================================
+ Hits          865      870       +5     
+ Misses        442      439       -3
Impacted Files Coverage Δ
src/scripts/components/wrapped-input.js 100% <ø> (ø) ⬆️
src/scripts/actions/items.js 100% <ø> (ø) ⬆️
src/scripts/components/wrapped-select.js 100% <ø> (ø) ⬆️
src/scripts/components/input.js 100% <ø> (ø) ⬆️
src/scripts/actions/choices.js 100% <ø> (ø) ⬆️
src/scripts/actions/groups.js 100% <100%> (ø) ⬆️
src/scripts/components/dropdown.js 100% <100%> (ø) ⬆️
src/scripts/lib/utils.js 74.24% <100%> (ø) ⬆️
src/scripts/actions/misc.js 100% <100%> (ø) ⬆️
src/scripts/store/store.js 92% <100%> (-1.34%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 452c8fa...53af566. Read the comment docs.

@jshjohnson jshjohnson changed the title Add type definitions Add missing type definitions + rename sortFn Nov 2, 2019
@tinovyatkin
Copy link
Contributor

tinovyatkin commented Nov 2, 2019

@jshjohnson can we rename sortFn to sortProvider? My breaking PR is to introduce searchProvider and make it easy to build autocomplete on top of Choices

And also removing completely all sort related settings - I mean, if sortProvider is set, then it makes all the rest of decisions.

I would like to do similar approach to searchProvider - it will allow us to decouple fuse.js and bunch of settings we are having around it now.

@tinovyatkin
Copy link
Contributor

That's also can be done in a way of deprecation - I mean, undocument old settings now, but still support it until next major.

@tinovyatkin
Copy link
Contributor

tinovyatkin commented Nov 2, 2019

BTW, my searchProvider will be supporting promises (similar to setChoices approach), not sure if that makes sense for sorting, but...

@jshjohnson
Copy link
Collaborator Author

BTW, my searchProvider will be supporting promises (similar to setChoices approach), not sure if that makes sense for sorting, but...

Hmm, hard to say without seeing your implementation. Do you mind if I keep this as is for the time being and if we think we need to update it after your search PR, we can?

@jshjohnson jshjohnson merged commit e6882f3 into master Nov 3, 2019
@jshjohnson jshjohnson deleted the add-type-definitions branch November 3, 2019 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Pull request that introduces a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants